<include file="Public:header" />
<script type="text/javascript" src="/Public/step-jquery-dc/step-jquery-dc.js"></script>
<link rel="stylesheet" href="/Public/step-jquery-dc/css/step-dc-style1.css" />

<form name="myform" id="myform" method="POST" action="">
	<input name="item_id" type="hidden" value="{$info['id']}">
  <input name="progress" id="progress" type="hidden" value="{$info['progress']|default='1'}">
  <fieldset>
    <legend>基本信息</legend>
    <table class="table_form" width="100%" cellspacing="0">
      <tbody>
      	<tr>
          <th width="80">联系人：</th>
          <td>{$info['name']}</td>
        </tr>
        <tr>
          <th>电话：</th>
          <td>{$info['phone']}</td>
        </tr>
        <tr>
          <th>区域：</th>
          <td>{$info.pid|getAreaInfo='name'}-{$info.cid|getAreaInfo='name'}-{$info.aid|getAreaInfo='name'}</td>
        </tr>
        <tr>
          <th>性别：</th>
           <td>{$info['sex']|sexArr}</td>
        </tr>
      </tbody>
    </table>
  </fieldset>
  <fieldset>
    <legend>跟进内容</legend>
    <table class="table_form" width="100%" cellspacing="0">
      <tbody>
      	<tr>
          <th width="80">进度：</th>
          <td><div class="step_context test" style="height:100px;"></div></td>
        </tr>
        <tr>
          <th></th>
          <td>

            <span>下次跟进时间：</span>
            <input id="talktime2" type="text" class="input-text Wdate" size="30" name="talktime2" value="" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" style="width:160px;" />

          </td>
        </tr>
        <tr class="last" >
          <th>内容：</th>
          <td><textarea name="content" id="editor" cols="4" rows="5" style="width:650px;"></textarea></td>
        </tr>

      </tbody>
    </table>
  </fieldset>
  <input type="submit" value="提交" class="dialog" id="dosubmit">
</form>
</body>
</html>
<script type="text/javascript" src="/Public/ueditor/ueditor.config.js"></script>	<!--ueditor编辑器-->
<script type="text/javascript" src="/Public/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="/Public/My97DatePicker/WdatePicker.js"></script>

<script type="text/javascript">
$(function(){
	$('#myform').ajaxForm({
		beforeSubmit:  checkForm,
		success:       complete,
		dataType: 'json'
	});
	function checkForm(){
		return true;
	}

	var origin = $.artDialog.open.origin;

    function complete(data){
    	msg(data.info,data.status);
		  if(data.status==1){
        setTimeout(function(){origin.location.reload();},1000);
      }
    }

})
</script>
<script>
$(document).ready(function(){

});
</script>
<script type="text/javascript">
UE.getEditor('editor',{
    //这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
    toolbars:[['FullScreen', 'Source', 'Undo', 'Redo','Bold','test']],
    //focus时自动清空初始化时的内容
    autoClearinitialContent:true,
    //关闭字数统计
    wordCount:false,
    //关闭elementPath
    elementPathEnabled:false,
    //默认的编辑区域高度
    initialFrameHeight:300
    //更多其他参数，请参考ueditor.config.js中的配置项
})

</script>

<script type="text/javascript">
//所有步骤的数据

var stepListJson=[{StepNum:1,StepText:"新来电"},
{StepNum:2,StepText:"了解意向"},
{StepNum:3,StepText:"推荐"},
{StepNum:4,StepText:"邀约"},
{StepNum:5,StepText:"邀约成功"},
{StepNum:6,StepText:"邀约成功"},
{StepNum:7,StepText:"邀约成功"},
{StepNum:8,StepText:"成交"}];

//var stepListJson = {$stepListJson};
var allNum = stepListJson.length;

//当前进行到第几步
var currentStep={$info['progress']|default='1'};
//new一个工具类
var StepTool = new Step_Tool_dc("test","mycall");
//使用工具对页面绘制相关流程步骤图形显示
StepTool.drawStep(currentStep,stepListJson);
//回调函数
function mycall(restult){
//  alert("mycall"+result.value+":"+result.text);
  if(result.value<currentStep){
    alert('客户进度只能前进不能后退！');
    return false;
  }
  StepTool.drawStep(result.value,stepListJson);
  $("#progress").val(result.value);
}
</script>